<%@ page contentType="text/html; charset=UTF-8"%>
<%@ include file="/jsp/taglib.jsp"%>
<!DOCTYPE html>
<html lang="en">
<!-- Mirrored from www.zi-han.net/theme/hplus/login_v2.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 20 Jan 2016 14:19:49 GMT -->
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">

    <title>修改密码</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link href="${ctxStatic}/plugins/h+/css/bootstrap.min.css" rel="stylesheet">
    <link href="${ctxStatic}/plugins/h+/css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
    <link href="${ctxStatic}/plugins/h+/css/animate.min.css" rel="stylesheet">
    <link href="${ctxStatic}/plugins/h+/css/style.min.css" rel="stylesheet">
    <link href="${ctxStatic}/plugins/h+/css/login.min.css" rel="stylesheet">
    <link href="${ctxStatic}/xmarket/css/newplus.css" rel="stylesheet">

    <!--[if lt IE 9]>
    <meta http-equiv="refresh" content="0;ie.html" />
    <![endif]-->

    <style>
        .login_jlname{
            font-size:40px;
            color:#fe6b04;
            margin:40px auto;
        }
        .positionralative{
            position:relative;
        }
        .backPsw{
            position: absolute;
            left: 310px;
            top: 9px;
            display: inline-table;
            cursor:pointer;
            color:#fe6b04;
        }
        .login_checkpsw{
            margin:15px auto;
        }
        .login_checkpsw label{
            cursor:pointer;
        }
        .btn-orange{
            background-color: #fe6b04;
            border-color: #fe6b04;
            color: #FFF;
        }
        .btn-orange:hover{
            color:#fff;
        }
        .col-padr-none{
            padding-right:0;
            margin-top:8px;
        }
    </style>
</head>
<body class="gray-bg">

<div class="middle-box text-center loginscreen  animated fadeInDown" style="width:400px;">
    <div>
        <div>
            <div class="login_jlname">修改密码</div>
        </div>
        <h3></h3>
        <form class="m-t" role="form" action="" onsubmit="return false;">
            <div class="row form-group text-left">
                <label class="col-sm-3 col-padr-none">当前密码：</label>
                <div class="col-sm-9">
                    <input type="password" id="pwdOld" name="pwdOld" class="form-control" placeholder="当前密码" required="">
                </div>
            </div>
            <div class="row form-group text-left">
                <label class="col-sm-3 col-padr-none">新密码：</label>
                <div class="col-sm-9">
                    <input type="password" id="pwdNew" name="pwdNew"  class="form-control" placeholder="输入新密码" required="">
                </div>
            </div>
            <div class="row form-group text-left">
                <label class="col-sm-3 col-padr-none">确认新密码：</label>
                <div class="col-sm-9">
                    <input type="password" id="pwdCheck" name="pwdCheck" class="form-control" placeholder="确认新密码" required="">
                </div>
            </div>
            <button type="button" onclick="toBack()" class="btn btn-jlorange">取消</button>
            <button type="button" onclick="doEdit()"  class="btn btn-jlorange">修改</button>
        </form>
    </div>
</div>


<div class="modal inmodal fade" id="myModal5" tabindex="-1" role="dialog"  aria-hidden="true">
    <div class="modal-dialog modal-sm">
        <div class="modal-content">

            <div class="modal-body">
                <div class="infolist">
                    <label>操作成功</label>
                </div>

            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-white"  onclick="toBack();">确定</button>
            </div>
        </div>
    </div>
</div>

<div class="modal inmodal fade" id="myModal6" tabindex="-1" role="dialog"  aria-hidden="true">
    <div class="modal-dialog modal-sm">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                <h4 class="modal-title">操作失败</h4>
            </div>
            <div class="modal-body">
                <div class="infolist">
                    <label id="msg"></label>
                </div>

            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
            </div>
        </div>
    </div>
</div>


<script src="${ctxStatic}/plugins/h+/js/jquery.min.js?v=2.1.4"></script>
<script src="${ctxStatic}/plugins/h+/js/bootstrap.min.js?v=3.3.5"></script>
<script src="${ctxStatic}/plugins/h+/js/plugins/jeditable/jquery.jeditable.js"></script>
<script src="${ctxStatic}/plugins/h+/js/plugins/dataTables/jquery.dataTables.js"></script>
<script src="${ctxStatic}/plugins/h+/js/plugins/dataTables/dataTables.bootstrap.js"></script>
<script src="${ctxStatic}/plugins/h+/js/content.min.js?v=1.0.0"></script>
<script>
    var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
    //将表单序列化成json格式的数据(但不适用于含有控件的表单，例如复选框、多选的select)
    (function($){
    })(jQuery);
function toBack()
{
    //window.history.go(-1);  //返回上一页
    parent.layer.close(index);
}
    function doEdit()
    {
        var pwdOld=$("#pwdOld").val();
        var pwdNew=$("#pwdNew").val();
        var pwdCheck=$("#pwdCheck").val();
        if(pwdNew!=pwdCheck)
        {
            $("#msg").html("两次输入的密码不一样！")
            $("#myModal6").modal('show');

        }else if(pwdNew==null||pwdNew==''||pwdNew==undefined)
        {
            $("#msg").html("请输入新密码")
            $("#myModal6").modal('show');
        }else if(pwdOld==null||pwdOld==''||pwdOld==undefined)
        {
            $("#msg").html("请输入原密码")
            $("#myModal6").modal('show');
        }
        else {
            $.ajax( {
                url:'${pageContext.request.contextPath}/QTMain/doEditPwd.ac',// 跳转到 action
                data:{
                    pwdOld :pwdOld,
                    pwdNew:pwdNew
                },
                type:'post',
                cache:false,
                dataType:'json',
                success:function(data) {
                    if(data.flag==1)
                    {
                        $("#myModal5").modal('show');
                    }
                    else{
                        $("#msg").html(data.msg);
                        $("#myModal6").modal('show');
                    }

                },
                error : function() {
                    alert("异常！");
                }
            });
        }
    }
</script>
</body>
</html>
